import { BaseController, CoolController } from "@cool-midway/core"
import { Inject, Post, Body } from "@midwayjs/core"
import { StorageInfoService } from "../../service/info"
import { AuditStorageInfoDTO } from "../../dto/info"
import { StorageInfoEntity } from "../../entity/info"

@CoolController({
    api: ['add', 'update', 'delete', 'info', 'list', 'page'],
    entity: StorageInfoEntity,
    service: StorageInfoService,
})
export class AdminStorageInfoController extends BaseController {
    @Inject()
    storageInfoService: StorageInfoService

    @Post('/audit')
    async audit(@Body() dto: AuditStorageInfoDTO) {
        return this.ok(await this.storageInfoService.audit(dto))
    }
}